Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

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?

Comments

  • 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.

    vrijvlinder
  • 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.

  • Dr_SommerDr_Sommer Dr. of tender Programing ;) ✭✭

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

    hgtonight
Sign In or Register to comment.