Announcement

Collapse
No announcement yet.

AJAX Paging

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • plongeur.com
    replied
    Hi, note that i changed it to include the last part in the function. Pagenav button would not work otherwise.

    Just for info, it bugs one the who's online page, and i just can't see any other page than the first one. I never really use it so it is nothing big but it is worth noticing.

    Leave a comment:


  • Glenn Vergara
    replied
    Glad the latest code works for you.

    Leave a comment:


  • plongeur.com
    replied
    Hi Glenn Vergara, I tried this on my test site in 5.3.1 and the last version of the code seems to work except when the page n buttons belox the threads are clocked, in this case the page is loaded in ajax.

    I am not 100% sure i want to go there but sure ajax implementation reduces the n of ad impressions in a big way...

    Edit : I think i got it right :

    Code:
    <script>
    $(function() {
        $(window).on('load', function () {
            $('.pagenav-form .arrow[href]').off('click').on('click', function(e) {
                return true;
            });
    
            $('.js-pagenum').off('keypress').on('keypress', function (e) {
                var pageNum = Number($(this).val()),
                    currentPageNum = Number($(this.form).find('.defaultpage').val());
                if (e.keyCode === 13) {
                    e.preventDefault();
                    if (pageNum !== currentPageNum) {
                        location.href = vBulletin.makePaginatedUrl(location.href, pageNum);
                    }
                }
            });
    
            $('.js-pagenav-button[href]').on('click', function(e) {
                e.stopImmediatePropagation();
            });
        });
    });
    </script>
    Last edited by plongeur.com; Fri 11th Aug '17, 7:07am.

    Leave a comment:


  • Glenn Vergara
    replied
    Try this updated code:

    Code:
    <script>
    $(function() {
        $(window).on('load', function () {
            $('.pagenav-form .arrow[href]').off('click').on('click', function(e) {
                return true;
            });
            
            $('.js-pagenum').off('keypress').on('keypress', function (e) {
                var pageNum = Number($(this).val()),
                    currentPageNum = Number($(this.form).find('.defaultpage').val());
                if (e.keyCode === 13) {
                    e.preventDefault();
                    if (pageNum !== currentPageNum) {
                        location.href = vBulletin.makePaginatedUrl(location.href, pageNum);
                    }
                }
            });
        });
    
        $('.js-pagenav-button[href]').on('click', function(e) {
            e.stopImmediatePropagation();
        });
    
    });
    </script>

    Leave a comment:


  • Glenn Vergara
    replied
    Originally posted by moonshiner View Post
    Hi,
    It works. but the ajax will start to work in a scenario of enter the page number in the input field, hit enter. After that pages are loading through ajax. Same effect in Firefox and chrome. Please try the scenario. Thanks
    Ok I will fix that.

    Leave a comment:


  • moonshiner
    replied
    Hi,
    It works. but the ajax will start to work in a scenario of enter the page number in the input field, hit enter. After that pages are loading through ajax. Same effect in Firefox and chrome. Please try the scenario. Thanks

    Leave a comment:


  • Glenn Vergara
    replied
    Works for me on my local instance of vB5. What browser are you using? Can you post a link?

    Leave a comment:


  • Pardeep Bagga
    replied
    it works on the pagination which is below thread, but on the pagination above thread it is not working

    Leave a comment:


  • Glenn Vergara
    replied
    Swordy and Pardeep Bagga, try this code now.

    Code:
    <script>
    $(function() {
        $(window).on('load', function () {
            $('.pagenav-form .arrow[href]').off('click').on('click', function(e) {
                return true;
            });
        });
    
        $('.js-pagenav-button[href]').on('click', function(e) {
            e.stopImmediatePropagation();
        });
    });
    </script>

    Leave a comment:


  • Glenn Vergara
    replied
    The purpose of the script is not to disable ajax but to intercept and stop the ajax call from happening when the pagination controls are clicked and then redirect to the paginated URL instead. I'll fix the script when I get a chance.

    Leave a comment:


  • Mark.B
    replied
    www.vbulletin.org is the best place to ask about this. We do not provide any support for modified code.

    v?ulletin 5 is heavily dependent on AJAX and if you start disabling it you could easily break other functionality.

    Leave a comment:


  • Pardeep Bagga
    replied
    i have added the hook its working on forum listing , but its still not working in thread view


    Originally posted by Glenn Vergara View Post
    Swordy, I found a solution to disable ajax paging.

    Create a template hook at footer_before_body_end location with the following code in the template:

    Code:
    <script>
    $(function() {
    $('.pagenav-form .arrow').off('click').on('click', function(e) {
    return true;
    });
    
    $('.js-pagenav-button').on('click', function(e) {
    e.stopImmediatePropagation();
    return true;
    });
    });
    </script>
    If you don't know how to create a template hook, go to one of my mods in my signature below. The instructions are similar.
    Last edited by Pardeep Bagga; Thu 21st Apr '16, 11:33pm.

    Leave a comment:


  • Glenn Vergara
    replied
    Try doing what I suggested. There might be something else going on with the original poster that my solution did not fully work for them.

    Leave a comment:


  • Pardeep Bagga
    replied
    i am also looking for a solution for the same, there must be a option to disable ajax as many of us doesn't require this

    Leave a comment:


  • Swordy
    replied
    It did and it didn't.

    On the main page where you are browsing threads then it works perfectly, however inside threads themselves it doesn't work and the pagination/browsing through AJAX is retained. I'm a little lost on why that is to be honest, I've taken out the CKEditor and a few other things just in case and the issue remains. Obviously it is possible to have the forum without this because using NoScript the link between pages is done via a normal page load.

    Why this is however, is still a mystery to us.

    I can see the vBulletin.pagination code in footer-rollup-517.js (when beautified obviously) but we don't really know enough about the forum as a code base to make many assumptions on what is being called by what and where, and we might be going down a dead-end with it here.

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X