how can i add ajax for infinite scrolling to wire posts?

Hello to all,how can i add ajax for infinite scrolling to wire posts?i know there are 2 plugins for  ajax  infinite scrolling( infinite scrolling,wach my page)but both of theme are not working to my community because i have a great plugin for river auto update(This one).Any suggestions?any other ways for ajax infinite scroll except those 2 plugins?

  • hi to all,finaly i design a plugin(thanks to elgghacks pianist)and works perfect!works in wire,work in blogs,except activity page!any ideas???

     

    here is the code

    $(document).ready(function() {

        $('a[data-pagination]').live('click', function(event) {

            var element = $(this);

            var wrapper_element = element.parents('.paginatorwrapper');   

            var hidden_paginator = $(wrapper_element,'.hiddenpaginator');

            var next_item = hidden_paginator.find('.elgg-state-selected').next('li').not('.elgg-state-disabled');

            if (next_item.length == 0) {

                return false;

            }

            wrapper_element.find('.ajaxloader.hidden').removeClass('hidden');

            element.hide();

            var next_link = $('a', next_item);

            var next_url = next_link.attr('href');

            $.ajax({

                url: next_url,

                success: function(html_data){

                    var listing = $(html_data).find('.elgg-list-entity:first');

                    var gallery = $(html_data).find('.elgg-gallery:first');

                    var river = $(html_data).find('.elgg-list-river:first');

                    var annotation = $(html_data).find('.elgg-list-annotation');

                    var new_pager = $(html_data).find('.paginatorwrapper');

                    if (listing.length > 0) {

                        $(wrapper_element).prev('.elgg-layout .elgg-list-entity').append(listing.children());

                    }    

                     if (gallery.length > 0) {

                        $(wrapper_element).prev('.elgg-layout .elgg-gallery').append(gallery.children());

                    }    

                    if (river.length > 0) {

                        $(wrapper_element).prev('.elgg-layout .elgg-list-river').append(river.children());

                    }  

                    if (annotation.length > 0) {

                        $(wrapper_element).prev('.elgg-layout .elgg-list-annotation').append(annotation.children());

                    }  

                    if (new_pager.length > 0) {

                        var new_hidden_paginator = new_pager.find('.elgg-state-selected').next('li').not('.elgg-state-disabled');

                        if (new_hidden_paginator.length == 0) {

                            $('.paginatorwrapper').remove();

                        } else {

                            $('.paginatorwrapper').replaceWith(new_pager);

                        }

                    } else {

                        $('.paginatorwrapper').remove();

                    }

                }

            });

        });

    });

  • @πανος Hehe. It's my code from Ajaxface plugin ;) @pianist just share it...

    I think that you're using some custom activity/river plugin which doesn't work with the above code

     

     

  • :) !!!!!!! @rivervanrain the conflict is with this plugin but that river auto update plugin is great because not dublicate posts or any other conflict!the only problem with this is not "allow" infinite scrolling plugins,i have try all the infinite scrolling plugins but nothing!the only script that was close was yours,works everywhere perfect except activity page

  • I find it insulting. You scream about conflicts, don't bother to explain or debug, then copy paste some code you don't even understand, and claim it works perfect. Well, good luck. People like you make me regret that I put so much effort into keeping my work open source.

  • @ihayredinov the code as i say above given me by pianist in elgghack,i say it clearly,i dont say its mine!!!where do i know pianist took the code from @rivervanrain????so he gave me the code and i openly ask here the pros how to make the code work.where is the immoral?i m not a development or programmer,i love elgg,i like that community and i trust the profesionals here.if you think is not good to ask ok then i m not asking again in here.

  • @πανος I think Ismayil Kharedinov was trying to tell you to identify the problem with the hypeList plugin and report the details here so he can get a fix for it. That way,  all other newbies like you won't be having same issues. This is how the community works and it helps a lot. You can always ask a question and elgg professionals are always here to help. Am not a programmer or a developer but with the help of prefessionals like Ismayil, Juho e.t.c. am really getting to know much about elgg and how to extend most of its features to my look and feel. I learn from other elgg members issues and the steps given by the prefessionals to resolve issues. Elgg Core developers put in a lot of work and time to developing elgg and this community. I think we can appreciate them by helping anyway we can. Thanks.