Skip to:
Content
Pages
Categories
Search
Top
Bottom

HTML editor doesn’t appear on bbpress 2.6.7


  • OSCOWP
    Participant

    @oscowordpress1

    Since I updated to 2.6.7 only appears now the visual but not the HTML…

    WHY?

Viewing 25 replies - 26 through 50 (of 54 total)

  • webcreations907
    Participant

    @webcreations907

    @robin-w if you remove the no-js in php, then it doesn’t allow the reason for adding it which would be to test if the browser supports javascript/jquery.

    Just an example
    Say you have a slider(JS dependent) that you only want to show if the browser supports js, then adding .no-js .my-slider{display:none;} would hide the slider if the browser didn’t support it, while if the browser supports JS then the no-js would be removed by JS and the slider would be displayed. Because the only way the class was removed was with JS which would verify the browser supports JS.

    So if you remove it with PHP then there is no test and the slider is shown regardless if the browser supports JS or not. Not sure what the percentage of browser users that have it disabled, sure it’s a very very small amount.

    You can see that in theme TwentyTwentyOne in template-functions.php the theme does it the same way I mentioned above in earlier post.

    Just wanted to mention it, hopefully it gets updated shortly and a fix gets out for it.


    Robin W
    Moderator

    @robin-w

    very happy for you to mention it 🙂

    Adding the no-js class to the bbpress body is something that bbpress 2.6.8 introduced. This was I am presuming on the presumption that that js was never needed on bbpress pages which is not the case in you want the visual editor or quicktags on the text editor.

    I’m simply taking it out for bbpress pages as a first step for those that need it, ie remving the change in 2.6.8 and reverting to the absence that bbpress has used for 7 years. My presumption is that the visual editor will not work on browsers that do not support js, which as you say is a very small amount if any actually used nowadays !!

    anyway thanks for your clarification, let’s see what the bbpress authors do.


    mr18
    Participant

    @mr18

    Thank you Robin W, everything is working now!
    I did as you suggested – and it helped!)

    I used:
    add_filter (‘bbp_body_class’, ‘rew_unset_no_js’) ;

    function rew_unset_no_js($classes) {
    if (in_array (‘single-forum’, $classes) || in_array (‘single-topic’, $classes)) {
    if (($key = array_search(‘no-js’, $classes)) !== false) {
    unset($classes[$key]);
    }
    }
    return $classes ;
    }


    mr18
    Participant

    @mr18

    But … when the theme of the site is updated, everything will disappear again.
    The theme file will lose these functions again.
    And again, the editor on the forum will disappear. It is so?


    lisabeavers
    Participant

    @lisabeavers

    I used code snippits and the first chunk of code you gave me and it appears to have worked! Thank you!


    Robin W
    Moderator

    @robin-w

    @mr18 – then suggestion is to either use this in a child theme functions file, which will not lose settings on a main theme update, or use code snippets, which does not change on a theme update.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @robin-w – any suggestions on improvements bbPress should make?

    I was thinking of renaming no-js to bbp-no-js to try and avoid an issue with other plugins or themes already doing something with that class, but I’m not sure that solves this specific problem.


    Robin W
    Moderator

    @robin-w

    @johnjamesjacoby

    as far as I understand, the issue is detailed in changeset 7190 – yes?

    so it is basically to hide the ‘generate passwword’ in form-user-passwords.php if the user’s browser does not support js or it is disabled.

    If so, at the moment all bbpress pages end up with a no-js class as bbpress sets ‘no-js’ as the default, which means that the quicktags do not display on the topic and reply forms as they need js but the css thinks it is no-js, and the visual editor does not work for the same reasons.

    At the moment you only test for js using the script technique in form-user-passwords.php viz

    <script type="text/javascript">
    	document.body.className = document.body.className.replace( 'no-js', 'js' );
    </script>

    so I would suggest 1 of 2 approaches

    1. putting this test in more generally so it runs on any bbpress page (as usefully suggested by @webcreations907) maybe by adding to the main function, or adding a filter in \includes\core\filters.php to run the script

    so something like :

    add_filter ('bbp_body_class' , bbp_test_js) ;
    function bbp_test_js ($classes) {
    ?>
    <script type="text/javascript">
    	document.body.className = document.body.className.replace( 'no-js', 'js' );
    </script>
    <?php
    return $classes ;
    }

    so that others could disable it

    2. changing the class to bbp-no-js should work, if you do this in the bbp_body_class function and the form-user-passwords.php and in css, then I can no reason why it would not work if that is the sole intention of this.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @robin-w 👍👍👍


    OSCOWP
    Participant

    @oscowordpress1

    When will be the update available?


    OSCOWP
    Participant

    @oscowordpress1

    It’s been nearly a week now…


    Robin W
    Moderator

    @robin-w

    @oscowordpress1

    There is a temporary fix, either

    1. use code

    if( !function_exists( 'bbpress_browser_supports_js' ) ){
    	function bbpress_browser_supports_js() {
    		echo '<script>document.body.classList.remove("no-js");</script>';
    	}
    	add_action( 'wp_footer', 'bbpress_browser_supports_js' );
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    or

    2. install and activate

    bbp style pack


    OSCOWP
    Participant

    @oscowordpress1

    Tried with bbstyle pack plugin and it’s not working.

    I’ll try tonight editing my template.


    Robin W
    Moderator

    @robin-w

    new version of bbp style pack just released that should work in all cases


    OSCOWP
    Participant

    @oscowordpress1

    It isn’t mate, at least for me it only appears the box without anything else, still doesn’t appear the labbels for text or visual.

    Ill probably go back to 2.6.6 at this point.


    Robin W
    Moderator

    @robin-w

    are you refreshing any caching plugins?


    OSCOWP
    Participant

    @oscowordpress1

    Nop, no working…


    Robin W
    Moderator

    @robin-w

    link to your site?


    OSCOWP
    Participant

    @oscowordpress1

    CocheSpias.net


    OSCOWP
    Participant

    @oscowordpress1

    And the bbpress developer has disappeared all together


    Robin W
    Moderator

    @robin-w

    your theme/developer has added the ‘no-js’ class to the very top, hence why the other codes are not working.

    can you try this snippet

    add_action( 'wp_footer', 'rew_supports_js' );
    
    function rew_supports_js() {
    	echo '<script>document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + " js ";</script>';
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    bbPress 2.6.9 was just released, but it does not make changes to this yet.

    I needed to rush out an Akismet fix first, and I’ll look more into this next.

    Thank you for being patient. Sorry for the wait. 🙏


    OSCOWP
    Participant

    @oscowordpress1

    It doesn’t work the new update but it’s nice to know that you are working for a fix


    packzap
    Participant

    @packzap

    I got the html text editor to appear in bbPress 2.6.9 after installing the bbp style pack plugin, going to the “topic reply form” tab, verifying that #9 Show editors is set for “text editor only” and then clicking “save changes” at bottom.

    Very cool plugin, by the way! Thanks for creating.


    OSCOWP
    Participant

    @oscowordpress1

    Yep but if you choose to show both, the label that allows you to choose between html or visual doesn’t appear

Viewing 25 replies - 26 through 50 (of 54 total)
  • You must be logged in to reply to this topic.
Skip to toolbar