ReadMore Download 5.1

This component/theme works with latest OSSN version.
German Arsalan Shah 2 months ago

This will make the lengthy contents in newsfeed smaller and ads button to show more text. (posts contents only).

This is a fork of existing component readmore (by Sathish Kumar ) which was marked not working. Please delete old readmore before using this one.

This component is updated to make it work with 5.x , doesn't change the effects on images as someusers complained they see a large images in newsfeed page, so to keep this point i didn't touched the images part.

v5.1
- Disable auto close of old readmore when new posts loaded.

Comments
German Holger A. Replied 2 weeks ago

It seems that the component is not working correctly, I can only use the English words in the German translation (I didn't made the translation, the language file was already added)

German Arsalan Shah Replied 2 weeks ago

Do you mean the component is not working or you are only talking about translation?

German Holger A. Replied 2 weeks ago

Hi, the component doesn't work in German, althouhgh there's a German language file available. Only the English words (Read more / close) will be shown in the German OSSN, but not the German translation "Mehr anzeigen" / "weniger".

Pashto / Pushto Abd ishtaya Replied 1 month ago

..

Ossn.RegisterStartupFunction(function(){
        $(document).ajaxComplete(function(event, xhr, settings) {

                    $('.post-contents:not([aria-expanded])').readmore({startOpen: false, speed: 100});
                    $('.blog-body:not([aria-expanded])').readmore({startOpen: false, speed: 100});
                    $('.blog-title:not([aria-expanded])').readmore({startOpen: false, speed: 100});
                    $('.blog-item:not([aria-expanded])').readmore({startOpen: false, speed: 100});
                    $('.message-box-sent:not([aria-expanded])').readmore({startOpen: false, speed: 100});
                    $('.message-box-recieved:not([aria-expanded])').readmore({startOpen: false, speed: 100});
                    $('.comment-text:not([aria-expanded])').readmore({startOpen: false, speed: 100});



        });
        $(document).ready(function(){
                $('.post-contents').readmore({startOpen: false, speed: 100});
                $('.blog-body').readmore({startOpen: false, speed: 100});         
                $('.blog-title').readmore({startOpen: false, speed: 100});
                $('.blog-item').readmore({startOpen: false, speed: 100});
                $('.message-box-sent').readmore({startOpen: false, speed: 100});
                $('.message-box-recieved').readmore({startOpen: false, speed: 100});
                $('.comment-text').readmore({startOpen: false, speed: 100});

        });
    });

..

Pashto / Pushto Abd ishtaya Replied 1 month ago

~Z~ Man
look at this

Ossn.RegisterStartupFunction(function(){
    $(document).ajaxComplete(function(event, xhr, settings) {

                        $('.post-contents:not([aria-expanded])').readmore({startOpen: false, speed: 100});

    });
    $(document).ready(function(){
        $('.post-contents').readmore({startOpen: false, speed: 100});
    });
});  
Ossn.RegisterStartupFunction(function(){
    $(document).ajaxComplete(function(event, xhr, settings) {

                        $('.blog-body:not([aria-expanded])').readmore({startOpen: false, speed: 100});

    });
    $(document).ready(function(){
        $('.blog-body').readmore({startOpen: false, speed: 100});
    });
});  
Ossn.RegisterStartupFunction(function(){
    $(document).ajaxComplete(function(event, xhr, settings) {

                        $('.blog-title:not([aria-expanded])').readmore({startOpen: false, speed: 100});

    });
    $(document).ready(function(){
        $('.blog-title').readmore({startOpen: false, speed: 100});
    });
}); 
Ossn.RegisterStartupFunction(function(){
    $(document).ajaxComplete(function(event, xhr, settings) {

                        $('.blog-item:not([aria-expanded])').readmore({startOpen: false, speed: 100});

    });
    $(document).ready(function(){
        $('.blog-item').readmore({startOpen: false, speed: 100});
    });
}); 
Ossn.RegisterStartupFunction(function(){
    $(document).ajaxComplete(function(event, xhr, settings) {

                        $('.message-box-sent:not([aria-expanded])').readmore({startOpen: false, speed: 100});

    });
    $(document).ready(function(){
        $('.message-box-sent').readmore({startOpen: false, speed: 100});
    });
}); 
Ossn.RegisterStartupFunction(function(){
    $(document).ajaxComplete(function(event, xhr, settings) {

                        $('.message-box-recieved:not([aria-expanded])').readmore({startOpen: false, speed: 100});

    });
    $(document).ready(function(){
        $('.message-box-recieved').readmore({startOpen: false, speed: 100});
    });
}); 




Ossn.RegisterStartupFunction(function(){
$(document).ajaxComplete(function(event, xhr, settings) {

    $('.comment-text:not([aria-expanded])').readmore({startOpen: false, speed: 100});

});
$(document).ready(function(){
$('.comment-text').readmore({startOpen: false, speed: 100});
});
});

..

Pashto / Pushto Abd ishtaya Replied 1 month ago

Can you create a script ( read more) on the blog for title and content ???

German ~Z~ Man Replied 1 month ago

James,
are there any news regarding your issue?

German ~Z~ Man Replied 1 month ago

Good idea Abd ishtaya!
Thanks for contributing.
To simplify things, we can add your 2 extra lines into the old code like:

 Ossn.RegisterStartupFunction(function(){
    $(document).ajaxComplete(function(event, xhr, settings) {
            var $url = window.location.href;
            $pagehandler = $url.replace(Ossn.site_url, '') + '/';
            if($pagehandler.includes('home/') || $pagehandler.includes('u/') || $pagehandler.includes('group/')){
                 $('.post-contents:not([aria-expanded])').readmore({startOpen: false, speed: 100});
                        $('.comment-text:not([aria-expanded])').readmore({startOpen: false, speed: 100});
            }
    });
 $(document).ready(function(){
 $('.post-contents').readmore({startOpen: false, speed: 100});
        $('.comment-text').readmore({startOpen: false, speed: 100});
 });
 }); 

Aside from that I changed the pagehandler code a bit to make Readmore work on Profile and Group pages.

Pashto / Pushto Abd ishtaya Replied 1 month ago

for comment in any post read more just append this data in components\ReadMore\plugins\default\js
eadmore.php

Ossn.RegisterStartupFunction(function(){
$(document).ajaxComplete(function(event, xhr, settings) {
var $url = window.location.href;
$pagehandler = $url.replace(Ossn.site_url, '');
$tocheck = ['home', 'user'];
if($tocheck.includes($pagehandler)){
$('.comment-text:not([aria-expanded])').readmore({startOpen: false, speed: 100});
}
});
$(document).ready(function(){
$('.comment-text').readmore({startOpen: false, speed: 100});
});
});
Pashto / Pushto Abd ishtaya Replied 1 month ago

Why not work for comments

Component

Developer: Arsalan
License ossnv3
Type: Tools
Minimum Requirement: 5.2
Latest Version: 5.1
Last Updated 1 month ago
Repository Url View Repository

Versions