• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Use readmore.js for blockquotes

Scheduled Pinned Locked Moved General Discussion
readmorejsjavascriptcustomizecustomizing
3 Posts 2 Posters 385 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    klockprat
    wrote on last edited by
    #1

    Hi!

    I'm migrating from another forum to hosted nodeBB but need som help with one important feature.

    We have some users that make long posts, and when someone quotes, the quote become equally long, this makes it cumbersome to scroll throught the topic.

    Other forums solve this by fading out, and a clickable "read more..." text that expands the big quotes.

    I was hoping to do this as well, but am failing. Mainly I hope due to my lacking knowledge in javascript.

    So I tried uploading readmore.min.js to /assets/uploads/... and added the following to custon javascript:

    function onLoad() {
        require(['/assets/uploads/readmore.min.js']);
        console.log('yeah it works');
        console.log($('blockquote'));
        $('blockquote').readmore();
    }
    
    $(document).ready(onLoad);
    $(window).on('action:ajaxify.end', onLoad);
    

    This gives me the following output in the console:

    86a146b2-755d-45ef-8924-e2b63c5849df-image.png

    Any help is much appreciated!

    K 1 Reply Last reply
    0
  • K Offline
    K Offline
    klockprat
    replied to klockprat on last edited by
    #2

    @klockprat I will look inte customizing the template file to achieve this instead

    1 Reply Last reply
    1
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #3

    Did you try with this?

    function onLoad() {
        require(['/assets/uploads/readmore.min.js'], function () {
           console.log('yeah it works');
           console.log($('blockquote'));
           $('blockquote').readmore();
        });
    }
    
    $(document).ready(onLoad);
    $(window).on('action:ajaxify.end', onLoad);
    
    1 Reply Last reply
    1

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development