Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Can I conditionally display another WYSIWYG-editor depending on if the client is mobile?

Hi

I use the cleditor-plugin but it doesn't work for the mobile clients. Is there some way to conditionally display the original editor for mobile clients and the cleditor for everyone else?

Alternatively, is there a nice looking WYSIWYG-editor that works for mobile clients?

Best Answers

Answers

  • No that didn't help @peregrine. The problem is that the Android keyboard comes up but then goes away immediately with the cleditor. This problem persists with MobileFriendly set to True in the plugins default.php file.

  • I meant to mark @R_J as the answer but I guess it doesn't matter. The key to the problem was MobileFriendly setting to FALSE in the cleditor plugins default.php.

  • peregrineperegrine MVP
    edited January 2015

    mobile friendly should default to false if it MobileFriendly is not in the plugin.

    and the default cleditor doesn not have MobileFriendly!

    setting it to True gives you the cleditor in mobile friendly.

    any plugin with that has the word "Plugin" attached to the name works this way.

    class cleditorPlugin extends Gdn_Plugin {


    some plugins like like this

    • class blaheditor extends Gdn_Plugin {

    vs.

    • class blaheditorPlugin extends Gdn_Plugin { // correct way until vanilla core is fixed.

    since there is a bug relating to this in vanilla, it does not work by the same rules.

    somewhere along the line you must have modified cleditor - hence the confusion...

    https://github.com/vanilla/vanilla/blob/2.1/plugins/cleditor/default.php#L53

    the default unmodified cleditor will not show up on mobile. I bet you modifed the plugin and created the issue.

    if you want to use buttonbar with only mobile and cleditor only with non mobile.

    use the cleditor that come with the core.

    and check for mobile in the buttonbar in the buttonbar plugin im the methods.

    if (!(IsMobile())  {
       return;
      }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • AnonymooseAnonymoose ✭✭
    edited January 2015

    @stemid said:
    Hi

    I use the cleditor-plugin but it doesn't work for the mobile clients. Is there some way to conditionally display the original editor for mobile clients and the cleditor for everyone else?

    That's the default behavior.

    CLE editor does not show up in mobile, the regular editor does.

    @peregrine said:
    the default unmodified cleditor will not show up on mobile.

    What he said.

  • Try the CKEditor... not perfect, but in my opinion the best wysiwyg Plugin for mobile and nonmobile... ;)

Sign In or Register to comment.