Skip to content

nodebb chat roll dice game

Solved Customisation
29 2 13.5k 1
  • wrote on last edited by
    #14

    @phenomlab

    I have test some CSS code but it’s difficult for me.

    I just manage to remove the span time but it also removes it for other system events appearing on the timeline.

    span.timeago.timeline-text {
        display: none;
    }
    

    c4a0ce7b-0aeb-4f22-9c20-f7a533e71b21-image.png

    I can’t figure out why the username and timestamp display correctly on one line and not on 2. It’s almost the same thing finally 😲

  • @phenomlab

    I have test some CSS code but it’s difficult for me.

    I just manage to remove the span time but it also removes it for other system events appearing on the timeline.

    span.timeago.timeline-text {
        display: none;
    }
    

    c4a0ce7b-0aeb-4f22-9c20-f7a533e71b21-image.png

    I can’t figure out why the username and timestamp display correctly on one line and not on 2. It’s almost the same thing finally 😲

    wrote on last edited by
    #15

    @DownPW This isn’t going to be a simple fix you can resolve with CSS. The issue here is how the plugin injects new code into an existing HTML structure, but doesn’t provide any means of identifying elements by ID rather than using a shared class name. Based on this, “best effort” is all that can be offered without directly changing any code.

    For example

    .dice-event-text {
        display: inline-block;
        align-items: center;
        flex-wrap: wrap;
        max-width: 800px;
        width: 800px;
    }
    

    This yields

    248f43d6-23c7-4e78-a9cd-329665161393-image.png

    Not perfect of course, but certainly better than what you have.

  • wrote on last edited by DownPW
    #16

    indeed it is better but it also modifies the result on 1 line…

    As you say, we can’t do much until the plugin is modified 😞

  • indeed it is better but it also modifies the result on 1 line…

    As you say, we can’t do much until the plugin is modified 😞

    wrote on last edited by
    #17

    @DownPW Yes, it’s not very elegant sadly, and there is an impact to other elements. You could write a jQuery function that only modifies the CSS when there are more than x of the same element in that div… 🙂

  • wrote on last edited by DownPW
    #18

    Why not @phenomlab but like you know, i’m not a good JS develloper 😉 lol
    I have not the skills for that 😞

  • wrote on last edited by DownPW
    #19

    @phenomlab do you think it is difficult to do?

    EDIT: https://community.nodebb.org/post/88897

  • @phenomlab do you think it is difficult to do?

    EDIT: https://community.nodebb.org/post/88897

    wrote on last edited by
    #20

    @DownPW said in nodebb chat roll dice game:

    do you think it is difficult to do?

    No, but judging by this

    https://github.com/NodeBB/NodeBB/pull/10837/commits/e7404fd7c3d401e6adb6246c23e5567cda136dec

    It might be best to wait - or if you can’t, you could easily patch that file, or overwrite it (public/src/modules/helpers.common.js)

  • wrote on last edited by DownPW
    #21

    @phenomlab said in nodebb chat roll dice game:

    It might be best to wait - or if you can’t, you could easily patch that file, or overwrite it

    ok but I don’t understand what the correction do for my problem ?

    The interpretation of HTML is better ?

  • @phenomlab said in nodebb chat roll dice game:

    It might be best to wait - or if you can’t, you could easily patch that file, or overwrite it

    ok but I don’t understand what the correction do for my problem ?

    The interpretation of HTML is better ?

    wrote on last edited by
    #22

    @DownPW yes, exactly. It’ll enable better element styling meaning a greater flexibility in terms of being able to target specific components

  • wrote on last edited by DownPW
    #23

    I will test to see if it’s better out of curiosity but I don’t think that will be enough…

  • wrote on last edited by DownPW
    #24

    That is what I thought. patching the file is not enough. Same result

  • That is what I thought. patching the file is not enough. Same result

    wrote on last edited by
    #25

    @DownPW did you rebuild and restart after patching?

  • That is what I thought. patching the file is not enough. Same result

    wrote on last edited by
    #26

    @DownPW from what I’ve read, the patch appears in core v2.5.0 and even then, this plugin would still need to be modified so that targeting classes is then available.

  • wrote on last edited by
    #27

    Yes I see that and the correctif with type event ID

  • Yes I see that and the correctif with type event ID

    wrote on last edited by
    #28

    @DownPW I still think you could do something much quicker with jQuery.

  • @DownPW I still think you could do something much quicker with jQuery.

    wrote on last edited by
    #29

    @phenomlab said in nodebb chat roll dice game:

    @DownPW I still think you could do something much quicker with jQuery.

    Why not but like I said, I have no skills to do that.

    If you are motivated, why not but I don’t want to bother you especially since it will only be for a certain period of time.


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee ☕
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics