Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding and removung buttons of front-end editors


  • tapiohuuhaa
    Participant

    @tapiohuuhaa

    Hi
    It is easy to customize backend buttons with the pugin “Post Editor Buttons Fork”, but it does work only in the backend. How I could add and remove buttons in front-end. I would like to add at least [SPOILER][/SPOILER] tag and i would lke to use [CODE][/CODE] insteaf of the default code button.

    Where is the code, which defines editor? Could I hardcode changes, which I want?

    Controlling the graphic editor TinyMCE Advanced might be more difficult. Is the alternatives for TinyMCE andvanced in the front-end. I would be nice to get.

    I have a temporary solution by using an additional menu. See https://www.sanaristikkofoorumi.net/wordpress/forums/topic/uusia-ominaisuuksia/?view=all#post-28829

Viewing 10 replies - 1 through 10 (of 10 total)

  • Milan Petrovic
    Participant

    @gdragon

    Hey,

    My GD bbPress Toolbox Pro plugin has 50 major new features, including BBCodes implementation that has 40+ shortcodes/BBCodes for bbPress forums, including SPOILER and HIDE, as well as full syntax highlighting SCODE shortcode.

    As for changing the main text editor buttons on the front end, I don’t know of any plugin that does it, and even the plugins that do it on the backend, don’t work on the frontend for some reason.

    Milan


    tapiohuuhaa
    Participant

    @tapiohuuhaa

    I have used your free version of GD bbPress Tools. I added SPOILER and few other tags with BBCode Deluxe. I edited the pugin. I commented all BBCode tags, which belongs to your plugin or which I don’t need.

    I have list fir extra code. I tryed to use JQuery to drag codes to the textare. Dragging cause that code disappears, but it just caused that the ekement disappeared from my list but but not went to the textarea.
    [CODE]$(“document”).ready(function() {
    $(“.tags”).draggable({
    revert: true
    });

    $(“.bbp-the-content”).droppable({
    accept: \’.tags\’,
    drop: function(event, ui) {
    $(this).append($(ui.draggable));
    }
    });
    });
    [/CODE]


    tapiohuuhaa
    Participant

    @tapiohuuhaa

    See my current sokution.
    https://imgbox.com/puH0BgPp

    If I mark carefully the needed code I can drag it to the editing field.


    tapiohuuhaa
    Participant

    @tapiohuuhaa

    I would lije to fork the cire code of WordPress concerning editors. I found TinyMCE related fike but I didn’t find where te’he button set if the text editor has been defined. I would fork the front-end side.


    Milan Petrovic
    Participant

    @gdragon

    Yeah, TinyMCE editor is very problematic when it comes to expanding it, it is way to complicated and easily broken.

    With by GD bbPress Toolbox Pro plugin, I have two additions for editing: BBCode Toolbar (simple extension of the basic editor with all BBCodes in the toolbar, and click on the button brings it into editor, or it can wrap selected text), and support for the Markdown. And, every BBCode can be disabled, or controlled for the Toolbar inclusion.

    Milan


    tapiohuuhaa
    Participant

    @tapiohuuhaa

    If the extension works on backend, it is is useless for me. I would need extensions only frontend. I have site for solving crosswords. Honoring other peoples all hints should give as default hided.

    I tried to find the button definitions for text editor. My idea is just replace
    DEL or CODE with SPOILER. If I would find the source code, maybe I could add some codes. That apparently needs alo finding filter code, which defines, which codes are allowed.

    I though also that I could replace some code and related texts and icons of TinyMCE with another code, texts an icons.

    So I would not need to add anything. But I didn’t find, where buttons have been defined for the text editor s d TinyMCE.

    BTW. I didn’t get frontend texts translated in your GD bbPress Tools. I deleted entire translation, which I made for it because filtering worked better, but filtering works only for texts, which don’t have dynamic texts (%s etc). I get with “My WP Translate” translated “WP Sitemap Page”, so the translation tool works. I have another issue here https://wordpress.org/support/topic/translating-into-finnish/. So could you answer there.


    tapiohuuhaa
    Participant

    @tapiohuuhaa

    I found files, which I must edit: wp-includes/js/quicktags.js and

    wp-includes/js/dist/blocks.js

    I replaced DEL-tags with SPOILER-tags. Now the text editor has SPOLER-tags. Replacing some button of TinyMCE might be too hard to implement.


    tapiohuuhaa
    Participant

    @tapiohuuhaa

    My GD bbPress Toolbox Pro plugin has 50 major new features, including BBCodes implementation that has 40+ shortcodes/BBCodes for bbPress forums, including SPOILER and HIDE, as well as full syntax highlighting SCODE shortcode.

    I looked your pro plugin. Does your additions work with TinyMCE, text editor or both text and graphic editor? For me your BBCode- support is unnecessary wide. I try to find where TinyMCE defines how to print strikeout. I creates DEL-tags. I would just like to replace DEL-tags with SPOILER-tags as I dId for the text editor.
    I found translation. With CSS I can change the text and icon. Dashicon f177 is closest available. With CSS can change the text just defining the font-size of the text 0 an replacing text by using the ::before pseudo-class.


    tapiohuuhaa
    Participant

    @tapiohuuhaa

    I used filter in krder to get SPOILER into the graphic editor:

    function custommm_functiooonn($content){<br />
    $content = str_replace(““,'[SPOILER ” apusisältö”]’,$content);<br />
    $content = str_replace(“
    “,”[/SPOILER]”,$content);<br />
    return $content; }<br />
    add_filter(‘bbp_get_topic_content’, ‘custommm_functiooonn’);<br />
    add_filter(‘bbp_get_reply_content’, ‘custommm_functiooonn’);

    Click the link, which is in the starting comment in order to see my solutions.

    If someone finds a better solution, I woulb be interested about it.

    In addition I changed language and CSS files in order to get reasonable solution. Relative satisfactory solution. The disadvantage of this solution js, that it is not possible to change the text, which is visible in web pages.


    tapiohuuhaa
    Participant

    @tapiohuuhaa

    A new trial. Even if there was “< + del + >” The text get strikethrough. Now I added extra spaces.

    function custommm_functiooonn($content){;<br />
    $content = str_replace(“< del >”,'[SPOILER ” apusisältö”]’,$content);
    $content = str_replace(“< / del >”,”[/SPOILER]”,$content);;<br />
    return $content; };<br />
    add_filter(‘bbp_get_topic_content’, ‘custommm_functiooonn’);<br />
    add_filter(‘bbp_get_reply_content’, ‘custommm_functiooonn’);

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar