How can I check which editor is in use?
#1
Hi!

I am using MyBB 1.8 and I need to know which posting editor is in use for my plugin. I thought, reading the config would be enough, but now I found out, that the enhanced editor is deactivated automatically on android tablets. How can I check in a php-script which editor is REALLY active, the plain html-one or the enhanced JavaScript one?

Thanks in advance!

BTW: Is there a mobile browser, which is capable to display the enhanced editor?
Reply
#2
(02-10-2015, 10:16 AM)Murray_B Wrote: I am using MyBB 1.8 and I need to know which posting editor is in use for my plugin. I thought, reading the config would be enough, but now I found out, that the enhanced editor is deactivated automatically on android tablets. How can I check in a php-script which editor is REALLY active, the plain html-one or the enhanced JavaScript one?

These are the checks you need on the PHP side - some of them depend on the current page ($forum['allowmycode'] in this case): https://github.com/mybb/mybb/blob/cb871f...y.php#L146

You can't check whether the JS decided to display SCEditor (without AJAX requests at least).

(02-10-2015, 10:16 AM)Murray_B Wrote: BTW: Is there a mobile browser, which is capable to display the enhanced editor?

It works on the Dolphin browser for me and should work on other most common browsers too: http://www.sceditor.com/documentation/br...atibility/
Reply
#3
Okay, I switched from:

if($mybb->settings['bbcodeinserter'] != 0)

to:

if($mybb->settings['bbcodeinserter'] != 0 && $forum['allowmycode'] != 0 && (!$mybb->user['uid'] || $mybb->user['showcodebuttons'] != 0)

and now it works! Great, thank you - but I have to admit, I don't know why…

And I tried with Firefox and Chrome current - I get no buttons, the sceditor is disabled. I now tried with android browser and get the buttons and the editor seems to work. But my text inserter does not work, I am using MyBBEditor.insertText for it. But I guess we can live with that. Thanks again!

Okay, I read again http://www.sceditor.com/documentation/br...atibility/ - Mobile browsers are not WYSIWYG-capable so sceditor disables itself and shows the plain textarea. For me I would call that "it is not working on mobile browsers"…
Reply
#4
it is browser specific; Firefox mobile does not show the editor (Android KitKat) but Chrome does.
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)