Skip to content

What is this bar called?

Solved Customisation
  • @Panda said in What is this bar called?:

    Far be it for me, with half a star, to disagree with someone with 4 stars, but it makes no difference to me if its vertical or horizontal.

    I wanted to add clarity to this point here for anyone else following this thread. The rating you have has %(#f50000)[absolutely zero] bearing when it comes to open discussion. There is no seniority over someone with half a star (for example) for someone with 5 stars.

    Both @DownPW and @Panda have made some very valid points and as a community it’s important that everyone

    • has a voice
    • is heard
    • is treated as an equal

    I understand that it’s difficult to convey tone when responding to something, or trying to get your point across, but please remember that English isn’t everyone’s primary language here, so sometimes things do get lost in translation, or don’t come across as the original poster intended.

    Either way, if you aren’t sure, it’s a good idea to ask for clarification (as I did previously in this thread).

    Thanks for reading -back to the topic in hand…

    @phenomlab yes, I was joking about my half star, but youre right, tone is hard to convey. I should have put a laughing emoji, as attempt at humour can be misinterpreted.

    Incidentally what is the fractional, not even half, star about?!
    When do I earn a full star? 😊

  • @phenomlab yes, I was joking about my half star, but youre right, tone is hard to convey. I should have put a laughing emoji, as attempt at humour can be misinterpreted.

    Incidentally what is the fractional, not even half, star about?!
    When do I earn a full star? 😊

    @Panda no issues at all. If you click on your half star, it’ll tell you how far away you are from the next level. At the rate you’re interacting, it won’t take long 👍

    Edit - if you go to your profile page and click your current level, that will tell you how many points you need to get to the next level.

    Seems you need 8 points.

  • @phenomlab yes, I was joking about my half star, but youre right, tone is hard to convey. I should have put a laughing emoji, as attempt at humour can be misinterpreted.

    Incidentally what is the fractional, not even half, star about?!
    When do I earn a full star? 😊

    @Panda said in What is this bar called?:

    Incidentally what is the fractional, not even half, star about?!

    You know, that’s a good point. There are lots of other forums around that use the same schematic, so I was being lazy and followed their lead. Open to suggestions on your this though.

  • @Panda said in What is this bar called?:

    Incidentally what is the fractional, not even half, star about?!

    You know, that’s a good point. There are lots of other forums around that use the same schematic, so I was being lazy and followed their lead. Open to suggestions on your this though.

    @phenomlab its a minor detail really.
    I clicked on it and saw Im not far away from a full star, but thats actually a hollow star (not filled in)
    So I suppose you would expect a half filled in star to progress to a filled in star?
    Anyway its a tiny detail.
    If using unfilled stars, maybe just start with one and increase the number of stars.

  • @phenomlab its a minor detail really.
    I clicked on it and saw Im not far away from a full star, but thats actually a hollow star (not filled in)
    So I suppose you would expect a half filled in star to progress to a filled in star?
    Anyway its a tiny detail.
    If using unfilled stars, maybe just start with one and increase the number of stars.

    @Panda yes, that’s a really good point. I’m using the pro version of Font Awesome but looking at it now after the point you just made, it seems somewhat nonsensical and should be changed.

    Either 0-50 gets one star and so on, or I use a different icon to show new users. I didn’t want anyone coming here to be without any form of recognition hence 0-50.

  • @phenomlab its a minor detail really.
    I clicked on it and saw Im not far away from a full star, but thats actually a hollow star (not filled in)
    So I suppose you would expect a half filled in star to progress to a filled in star?
    Anyway its a tiny detail.
    If using unfilled stars, maybe just start with one and increase the number of stars.

    On a more important point, I made a post on Nodebb trying to clarify why Reputation is stored as two values in the database
    A reputation value
    A reputation score

    It seems somewhat duplicated, can you explain the difference

  • On a more important point, I made a post on Nodebb trying to clarify why Reputation is stored as two values in the database
    A reputation value
    A reputation score

    It seems somewhat duplicated, can you explain the difference

    @Panda I think the value is for the icon, and the score is the actual number.

  • @Panda I think the value is for the icon, and the score is the actual number.

    @phenomlab
    As a design point, always a risk for bugs having duplicated data.
    It would be better to just store score, and then get the icon from the table that stores icon cutoffs.

  • @phenomlab
    As a design point, always a risk for bugs having duplicated data.
    It would be better to just store score, and then get the icon from the table that stores icon cutoffs.

    @Panda yes, that’s hard to argue. I’d just store numbers then use logic to determine which icon should be issued based on that.

    However, I do see the reasoning for NodeBB’s approach s this was previously a community plugin and backwards completely of course has to be considered.

  • @Panda yes, that’s hard to argue. I’d just store numbers then use logic to determine which icon should be issued based on that.

    However, I do see the reasoning for NodeBB’s approach s this was previously a community plugin and backwards completely of course has to be considered.

    @phenomlab
    Just my personal opinion, I wish it had been left as plugin. Im assuming from your comment Reputation code is core now?

    I disabled this reputation on some forums. Have you seen the 10rules of how its calculated?
    One of rules is something like:
    by down-voting the object user loses x% subject to maxmin(5,50) and the subject loses y%, subject to criterias 1-10.
    All sounded a bit complicated!
    I am fundementally minimalist, so despite Flarums list of disadvantages, it has a clean start position.
    NodeBB should be wary of throwing too much in as default and then ending up with bugs.
    Just my opinion

  • @phenomlab
    Just my personal opinion, I wish it had been left as plugin. Im assuming from your comment Reputation code is core now?

    I disabled this reputation on some forums. Have you seen the 10rules of how its calculated?
    One of rules is something like:
    by down-voting the object user loses x% subject to maxmin(5,50) and the subject loses y%, subject to criterias 1-10.
    All sounded a bit complicated!
    I am fundementally minimalist, so despite Flarums list of disadvantages, it has a clean start position.
    NodeBB should be wary of throwing too much in as default and then ending up with bugs.
    Just my opinion

    @Panda yes, that’s why I disabled down voting here. If you don’t like a post, move on. Simple.

    It’s still a plugin, but officially supported by NodeBB. The user level plugin doesn’t have any bearing on reputation. There is another plugin that exerts greater control over the reputation system and I think you might have that installed (as I do). From recollection, the core values are quite basic unless there’s something in the underlying code that would dictate otherwise?

  • Seems to be very good. Can you give code CSS & JS for that and I Can test ?

    @DownPW said in What is this bar called?:

    Seems to be very good. Can you give code CSS & JS for that and I Can test ?

    Of course - but beware as some of this code will be in use in the existing progress bar you have (specifically #pageup)

    JS

    $(document).on("click", "#pageUp", function(e) {
    const firstTopic = $('[component="category/topic"][data-index="0"]');
    if (firstTopic.length) {
    $("html, body").animate({
    scrollTop: 0
    }, '300');
    } else {
    ajaxify.refresh();
    }
    });

    CSS

    #pageUp {
    display: inline-block;
    background: var(--bs-body-component-active);
    width: 50px;
    height: 50px;
    text-align: center;
    border-radius: 0.375rem;
    position: fixed;
    bottom: 70px;
    right: 80px;
    transition: background-color .3s, opacity .5s, visibility .5s;
    opacity: 0;
    visibility: hidden;
    }
    #pageUp.show {
    opacity: 1;
    visibility: visible;
    z-index: 10000;
    color: var(--bs-body-navbar-color) !important;
    }
    a#pageUp.show:hover {
    background: var(--bs-dropdown-link-hover-bg);
    border: 1px solid var(--bs-border-color);
    }
    a#pageUp i {
    position: absolute;
    top: 32%;
    left: 35%;
    }
    @media (max-width: 767px) {
    #pageUp {
    bottom: 60px;
    right: 30px;
    }
    }
  • Hi @phenomlab

    Thanks for sharing 🙂

    It’s the code for this reading bar :

    image.png

    In my point of view, it’s definitively better 😉

  • @phenomlab

    It seems to be missing things because I don’t have the reading bar in the header and not have the button at the bottom right too 🙄

    Could you provide me with the complete code in JS & CSS as if I was starting from scratch?

  • @phenomlab

    It seems to be missing things because I don’t have the reading bar in the header and not have the button at the bottom right too 🙄

    Could you provide me with the complete code in JS & CSS as if I was starting from scratch?

    @DownPW Here you go. Remove any other references you have in custom JS that relate to the previous progress bar, and replace with this

    // Scroll to top function
    $(window).on('action:ajaxify.end', function(data) {
    var matched = false;
    $(document).ready(function() {
    var pageUp = $('#pageUp');
    var bar = $('.reading-meter');
    var perWidth = $('.reading-meter').width();
    // Main progressbar function
    function pageScroller() {
    var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
    var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
    var scrolled = (winScroll / height) * 100;
    document.getElementById("progress-bar").style.width = parseFloat(scrolled).toFixed(0) + "%";
    $('#percentage').val(parseFloat(scrolled).toFixed(0) + "%");
    // Prevent the mouse scroll wheel from scrolling down after the pageUp button is clicked
    if ($('#pageUp').is(':focus')) {
    event.preventDefault();
    }
    }
    // Bind the pageScroller function to the window's scroll event
    $(window).scroll(function() {
    pageScroller();
    });
    // Check the URL and composer visibility separately from the scroll event
    $(window).scroll(function() {
    var thisURL = window.location.href;
    var checkURL = ["topic", "notifications", "user"];
    var isFound = false;
    for (var i = 0, len = checkURL.length; i < len; i++) {
    if (thisURL.indexOf(checkURL[i]) > -1) {
    isFound = true;
    break;
    }
    }
    if (isFound) {
    bar.removeClass('show');
    pageUp.removeClass('show');
    } else {
    // Exception here is that we don't want the scroll bar to show when the composer is active
    if ($(window).scrollTop() > 0 && (!$('[component="composer"]').is(":visible"))) {
    bar.addClass('show');
    pageUp.addClass('show');
    } else {
    bar.removeClass('show');
    pageUp.removeClass('show');
    }
    }
    });
    // Scroll to top when #pageUp is clicked
    $(document).on("click", "#pageUp", function(e) {
    const firstTopic = $('[component="category/topic"][data-index="0"]');
    if (firstTopic.length) {
    $("html, body").animate({
    scrollTop: 0
    }, '300');
    } else {
    ajaxify.refresh();
    }
    });
    });
    });

    Now in the custom header, remove the previous code that probably looks something like this

    <div id="readingposition" class="reading-meter" style="bottom: 0px;">
    <div class="pageUp" id="pageUp"><i class="fa fa-angle-double-left pointer" aria-hidden="true"></i></div>
    <div class="pageDown" id="pageDown"><i class="fa fa-angle-double-right pointer" aria-hidden="true"></i></div>
    <div class="reading-meter-background rounded-1 border border-gray-300 ready">
    <div class="reading-meter-progress-bar rounded-1" id="progress-bar">
    <input disabled="disabled" type="text" id="percentage" name="percentage">
    </div>
    </div>
    </div>

    And replace with this

    <a id="pageUp" class=""><i class="fas fa-chevron-up"></i></a>
    <div id="readingposition" class="reading-meter" style="bottom: 0px;">
    <div class="reading-meter-background rounded-1 border border-gray-300 ready">
    <div class="reading-meter-progress-bar rounded-1" id="progress-bar">
    </div>
    </div>
    </div>

    Now use the CSS provided below (note, that you may have previous CSS that already exists if you used the older version of the progress bar - you should remove that)

    #pageUp {
    display: inline-block;
    background: var(--bs-body-component-active);
    width: 50px;
    height: 50px;
    text-align: center;
    border-radius: 0.375rem;
    position: fixed;
    bottom: 70px;
    right: 80px;
    transition: background-color .3s, opacity .5s, visibility .5s;
    opacity: 0;
    visibility: hidden;
    }
    #pageUp.show {
    opacity: 1;
    visibility: visible;
    z-index: 10000;
    color: var(--bs-body-navbar-color) !important;
    }
    a#pageUp.show:hover {
    background: var(--bs-dropdown-link-hover-bg);
    border: 1px solid var(--bs-border-color);
    }
    a#pageUp i {
    position: absolute;
    top: 32%;
    left: 35%;
    }
    .reading-meter {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    height: 2px !important;
    }
    .reading-meter {
    visibility: hidden;
    }
    .reading-meter.show {
    visibility: visible;
    }
    div#readingposition {
    background-color: var(--bs-body-navbar) !important;
    color: var(--bs-body-color) !important;
    height: 2px;
    z-index: 1000;
    }
    .reading-meter-progress {
    border: 1px solid var(--bs-border-color);
    width: 100%;
    }
    .reading-meter-background {
    background: var(--bs-body-bg);
    }
    .reading-meter-progress-bar {
    background: var(--bs-progress-bg-bar);
    height: 2px;
    }
    input#percentage {
    display: none;
    }
    @media (max-width: 767px) {
    #pageUp {
    bottom: 60px;
    right: 30px;
    }
    }

    That should do it.

  • Will test ASAP, i’m on new OGproxy conf now

  • @DownPW Here you go. Remove any other references you have in custom JS that relate to the previous progress bar, and replace with this

    // Scroll to top function
    $(window).on('action:ajaxify.end', function(data) {
        var matched = false;
        $(document).ready(function() {
            var pageUp = $('#pageUp');
            var bar = $('.reading-meter');
            var perWidth = $('.reading-meter').width();
            
            // Main progressbar function
            function pageScroller() {
            var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
            var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
            var scrolled = (winScroll / height) * 100;
    
            document.getElementById("progress-bar").style.width = parseFloat(scrolled).toFixed(0) + "%";
            $('#percentage').val(parseFloat(scrolled).toFixed(0) + "%");
    
            // Prevent the mouse scroll wheel from scrolling down after the pageUp button is clicked
            if ($('#pageUp').is(':focus')) {
            event.preventDefault();
            }
        }
    
            // Bind the pageScroller function to the window's scroll event
            $(window).scroll(function() {
                pageScroller();
            });
    
            // Check the URL and composer visibility separately from the scroll event
            $(window).scroll(function() {
                var thisURL = window.location.href;
                var checkURL = ["topic", "notifications", "user"];
                var isFound = false;
                for (var i = 0, len = checkURL.length; i < len; i++) {
                    if (thisURL.indexOf(checkURL[i]) > -1) {
                        isFound = true;
                        break;
                    }
                }
                if (isFound) {
                    bar.removeClass('show');
                    pageUp.removeClass('show');
                } else {
                    // Exception here is that we don't want the scroll bar to show when the composer is active
                    if ($(window).scrollTop() > 0 && (!$('[component="composer"]').is(":visible"))) {
                        bar.addClass('show');
                        pageUp.addClass('show');
                    } else {
                        bar.removeClass('show');
                        pageUp.removeClass('show');
                    }
                }
            });
    
            // Scroll to top when #pageUp is clicked
            $(document).on("click", "#pageUp", function(e) {
                const firstTopic = $('[component="category/topic"][data-index="0"]');
                if (firstTopic.length) {
                    $("html, body").animate({
                        scrollTop: 0
                    }, '300');
                } else {
                    ajaxify.refresh();
                }	
            });
        });
    });
    
    

    Now in the custom header, remove the previous code that probably looks something like this

    <div id="readingposition" class="reading-meter" style="bottom: 0px;">
        <div class="pageUp" id="pageUp"><i class="fa fa-angle-double-left pointer" aria-hidden="true"></i></div>
        <div class="pageDown" id="pageDown"><i class="fa fa-angle-double-right pointer" aria-hidden="true"></i></div>
        <div class="reading-meter-background rounded-1 border border-gray-300 ready">
        <div class="reading-meter-progress-bar rounded-1" id="progress-bar">
            <input disabled="disabled" type="text" id="percentage" name="percentage">
            </div>
      </div>  
      </div>
    

    And replace with this

    <a id="pageUp" class=""><i class="fas fa-chevron-up"></i></a>
    <div id="readingposition" class="reading-meter" style="bottom: 0px;">
        <div class="reading-meter-background rounded-1 border border-gray-300 ready">
        <div class="reading-meter-progress-bar rounded-1" id="progress-bar">
            </div>
      </div>  
      </div>
    

    Now use the CSS provided below (note, that you may have previous CSS that already exists if you used the older version of the progress bar - you should remove that)

    #pageUp {
      display: inline-block;
      background: var(--bs-body-component-active);
      width: 50px;
      height: 50px;
      text-align: center;
      border-radius: 0.375rem;
      position: fixed;
      bottom: 70px;
      right: 80px;
      transition: background-color .3s, opacity .5s, visibility .5s;
      opacity: 0;
      visibility: hidden;
    }
    #pageUp.show {
      opacity: 1;
      visibility: visible;
      z-index: 10000;
      color: var(--bs-body-navbar-color) !important;
    }
    a#pageUp.show:hover {
      background: var(--bs-dropdown-link-hover-bg);
      border: 1px solid var(--bs-border-color);
    }
    a#pageUp i {
        position: absolute;
        top: 32%;
        left: 35%;
    }
    .reading-meter {
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
        right: 0;
        height: 2px !important;
    }
    .reading-meter {
        visibility: hidden;
    }
    .reading-meter.show {
        visibility: visible;
    }
    
    
    div#readingposition {
        background-color: var(--bs-body-navbar) !important;
        color: var(--bs-body-color) !important;
        height: 2px;
        z-index: 1000;
    }
    
    .reading-meter-progress {
        border: 1px solid var(--bs-border-color);
        width: 100%;
    }
    
    .reading-meter-background {
        background: var(--bs-body-bg);
    }
    
    .reading-meter-progress-bar {
        background: var(--bs-progress-bg-bar);
        height: 2px;
    }
    input#percentage {
        display: none;
    }
     
    @media (max-width: 767px) {
        #pageUp {
            bottom: 60px;
            right: 30px;
          }
        }
     
    
    

    That should do it.

    And where you put/replace this @phenomlab ? :

    @phenomlab said in What is this bar called?:

    And replace with this

    <div id="readingposition" class="reading-meter" style="bottom: 0px;">
    <div class="reading-meter-background rounded-1 border border-gray-300 ready">
    <div class="reading-meter-progress-bar rounded-1" id="progress-bar">
    </div>
    </div>
    </div>```

    In the custom header I guess ?

  • It seems to be worse. The JS no longer works.

    When I remove the customJS and custom Header code. The website is OK

    Could there be an error/omission in the given code? A typo in the code?

  • It seems to be worse. The JS no longer works.

    When I remove the customJS and custom Header code. The website is OK

    Could there be an error/omission in the given code? A typo in the code?

    @DownPW strange. Is this on your dev server? I’ll take a look tomorrow morning.

  • nope on my VM but you have an account on dev server

  • Did this solution help you?
    Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗


31/92

9 Jul 2023, 12:29


Threaded Replies


Related Topics
  • 4 Votes
    28 Posts
    626 Views
    @Panda said in NodeBB v4.0.0: the workings of World aren’t intuitive Its not easy to get World populating when a forum is new to it This is a good point and one I’ve considered also. It’s a little confusing to be honest.
  • Nodebb design

    Solved General 11 Jul 2023, 10:13
    1 Votes
    2 Posts
    370 Views
    @Panda said in Nodebb design: One negative is not being so good for SEO as more Server side rendered forums, if web crawlers dont run the JS to read the forum. From recollection, Google and Bing have the capability to read and process JS, although it’s not in the same manner as a physical person will consume content on a page. It will be seen as plain text, but will be indexed. However, it’s important to note that Yandex and Baidu will not render JS, although seeing as Google has a 90% share of the content available on the web in terms of indexing, this isn’t something you’ll likely lose sleep over. @Panda said in Nodebb design: The “write api” is preferred for server-to-server interactions. This is mostly based around overall security - you won’t typically want a client machine changing database elements or altering data. This is why you have “client-side” which could be DOM manipulation etc, and “server-side” which performs more complex operations as it can communicate directly with the database whereas the client cannot (and if it can, then you have a serious security flaw). Reading from the API is perfectly acceptable on the client-side, but not being able to write. A paradigm here would be something like SNMP. This protocol exists as a UDP (UDP is very efficient, as it is “fire and forget” and does not wait for a response like TCP does) based service which reads performance data from a remote source, thus enabling an application to parse that data for use in a monitoring application. In all cases, SNMP access should be “RO” (Read Only) and not RW (Read Write). It is completely feasible to assume complete control over a firewall for example by having RW access to SNMP and then exposing it to the entire internet with a weak passphrase. You wouldn’t do it (at least, I hope you wouldn’t) and the same ethic applies to server-side rendering and the execution of commands.
  • 7 Votes
    18 Posts
    1k Views
    @Panda Just circling back here with something of an update (which I think you’ll like). I’ve completely restructured the ranking system. There are now less ranks, with a higher point threshold to reach them. More importantly, if you reload the site, you’ll notice that the ranks are now icons. I also removed the “Author” badge, and made this a single icon, which (to me) looks much better.
  • 3 Votes
    17 Posts
    994 Views
    @mventures Ok. No issues
  • 1 Votes
    6 Posts
    391 Views
    Up to you really
  • 8 Votes
    41 Posts
    4k Views
    @phenomlab said in Footer bar add center text: div#console-nav-tab Ah ok test with bottom: 0px !important; idem
  • 4 Votes
    33 Posts
    3k Views
    @phenomlab I find the problem Mark The error message indicated this path : http://localhost:4567/assets/plugins/nodebb-plugin-emoji/emoji/styles.css?v=6983dobg16u I change the path url on config.json [image: 1645128773854-47bacc80-f141-41e4-a261-3f8d650cc6f6-image.png] And all it’s good Weird, I didn’t have to change that path before 1.19.3 But this does not prevent the problem from a clean install with Emoji Plugin EDIT: After test, that resolv the problem installation for 1.18.x but not for 1.19.x (I have other error message when I run ./nodebb Setup For resume: NodeJS 16_x with 1.18.x is ok
  • 0 Votes
    7 Posts
    1k Views
    @RiekMedia hi. Just following up on this thread (I know it’s old) but was curious to understand if it’s still an issue or not ?