Forum Activity for @tig

TiG
@tig
09/19/17 07:14:44PM
184 posts

tinyMCE on Mobile Devices


Jamroom Developers

We recognize jamroom dissuades using tinyMCE on mobile devices. However, we have a need to provide tinyMCE for mobile devices for creating / changing blog articles. Unfortunately it looks as though there is logic deep in the core (page.php as one example) that swaps 'editor' for 'textarea' for mobile devices.

 // If this is a mobile device, and we are asking for an editor, we use a text area instead
 if ($_field['type'] == 'editor' && jrCore_is_mobile_device()) {
        $_field['type'] = 'textarea';
 }

This is not code we will override (for obvious reasons). Anyone know of a technically prudent way to accomplish the goal of using tinyMCE as the editor for Blogs? An appropriate listener would do the trick.

Will keep looking, but thought I would raise the question in hopes of an easy method.
updated by @tig: 12/21/17 07:20:46PM
TiG
@tig
09/19/17 09:14:29AM
184 posts

Use of display:table vs. display:block for Editor


Jamroom Developers

@brian

Got it. Yeah I suppose in our view each comment is its own little world. The site style is the framework but the comments are free to individual expression. And ... if we needed to in the future for some reason ... we could apply a little 'conforming' algorithm to stored comments. That is, if we chose to force the users to conform to a particular style. :)

Have you considered providing a bbcode toolbar endowed editor? That would stay within your advice yet provide a very nice option for mobile devices (and beyond).

Thanks much, Brian, for your insight.
TiG
@tig
09/19/17 08:56:54AM
184 posts

Use of display:table vs. display:block for Editor


Jamroom Developers

@brian

Thanks much for that explanation. Will discuss with Perrie regarding mobile. However ...

brian:
In fact - we recommend that you do NOT use the editor at all for user-facing input - period. The problem is that it will inject HTML and inline CSS into the text, which down the road if you ever choose to change the CSS/style of your site, you'll always be stuck with "ugly" HTML that cannot be modified.

I am reading that we should not allow our users to use tinymce under any conditions (all devices) because it allows them to stylize their comments with HTML and CSS. Am I misinterpreting? I ask because we have a rather profound need to allow boldface, etc., text changes, blockquotes, inserting images, video, etc. into comments, etc. Inserting bbcode tags would never fly - would at least need a toolbar.

Just ensuring I am correctly understanding your advice.
TiG
@tig
09/19/17 08:18:38AM
184 posts

Use of display:table vs. display:block for Editor


Jamroom Developers

On mobile devices, the tinymce editor will expand when editing. Seems to me this is a result of template comment_form.tpl wrapping the editor within display:table... tags (especially table-cell):

<div class="item" style="display:table">
            <div style="display:table-row">
                <div class="p5" style="display:table-cell;width:5%;vertical-align:top;">
                    {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$_user._user_id size="small" alt=$item.user_name class="action_item_user_img iloutline" _v=$_user.user_image_time}
                </div>
                <div class="p5" style="display:table-cell;width:95%;padding:5px 12px;">
                    <a id="cform"></a>
                    <form id="{$jrComment.unique_id}_form" action="{$jamroom_url}/{$curl}/comment_save" method="POST" onsubmit="jrPostComment('#{$jrComment.unique_id}', 'undefined', 500);return false">
                    . . .   
                    </form>
                </div>
            </div>
        </div>
        
        . . .


I plan to customize this for at least mobile devices to replace the display:table, display:table-row, display:table-cell with display:block (and of course a few more adjustments) but I would prefer to understand why table tags were used in the first place.

This question is simply a due diligence to mitigate side-effects.
updated by @tig: 12/18/17 02:17:44PM
TiG
@tig
09/18/17 08:23:34AM
184 posts

Configuring Tinymce


Jamroom Developers

@michael

Thanks for that valuable info.

The 'ul' and 'li' tags are listed in the allowed HTML tags section so the smarty logic should kick in. Based on your reply I will now assume they are properly set and continue my hunting with that assumption. Probably some little nit that is causing this.

[ As an aside, I too favor the file overrides since that keeps all changes within the scope of tools such as PHPStorm. Search is so important and it is frustrating when actionable code (especially override code) is stuck away in a database outside of the reach of development tools. ]
TiG
@tig
09/17/17 05:48:09PM
184 posts

Configuring Tinymce


Jamroom Developers

Besides Core->Quota Allowed HTML, etc. and jrCore form_editor.tpl are there other places which contribute to the configuration of Tinymce? Specifically, I am trying to determine why toolbar options such as bullist and numlist do not show up on the Tinymce toolbar.

They are there in the toolbar spec, but are smarty-conditioned with logic such as {if $ul || $li}. It would save me considerable time hunting if I knew where/how these variables are set.

Thanks in advance.
updated by @tig: 12/24/17 03:55:37AM
TiG
@tig
09/11/17 09:50:21PM
184 posts

Keeping $_user Timely


Jamroom Developers

@michael - inserted line is working like a charm. Beautiful. Thanks.
TiG
@tig
09/11/17 07:40:32PM
184 posts

Keeping $_user Timely


Jamroom Developers

This relates to SimpleChat but it is a question in general. What (if any) is the recommended method for refreshing $_user to reflect recent changes? Imagine, as with SimpleChat, a user changes a setting. The setting change is immediately persisted but $_user is not updated until (it seems) the user logs out / in.

Is there a function designed to update $_user after user properties are changed?
updated by @tig: 12/11/17 04:30:21PM
TiG
@tig
09/01/17 03:02:11PM
184 posts

Simple Chat for Mobile Devices


Jamroom Developers

@brian - Excellent! I will look go to a standard skin and find it. I am working with Perrie's customized skin so that explains why it does not show up. Looks like a bit of skin freshening is in order. :) Thanks for info.
TiG
@tig
09/01/17 02:41:50PM
184 posts

Simple Chat for Mobile Devices


Jamroom Developers

@brian

There it is! Okay, let me refine my question now. Why is the chat button not being displayed on mobile devices? The functionality on mobile could be to navigate to the chat URL.

Thanks.
  16