Forum Activity for @michael

michael
@michael
12/09/18 09:46:14PM
7,821 posts

Is it feasible to build a central "Text editor settings" control module?


Suggestions

lol :) Its possible to build. If its a super-necessity get a few people together and sponsor it as a module.
michael
@michael
12/09/18 08:13:04PM
7,821 posts

Is it feasible to build a central "Text editor settings" control module?


Suggestions

@strumelia :) nice one!

@researchcooperative
A line of the form_editor.tpl template currently looks like this
    toolbar1: "formatselect | fontselect fontsizeselect forecolor {if $strong} bold{/if}{if $em} italic{/if}{if $span} underline{/if} removeformat | {if $span || $div} alignleft{/if}{if $span || $div} aligncenter{/if}{if $span || $div} alignright{/if}{if $span || $div} alignjustify |{/if}{if $ul || $ol || $li}{if $ul || $li} bullist{/if}{if $ol} numlist{/if} |{/if}{if $div} outdent indent |{/if} undo redo | link unlink anchor pagebreak{if $table} table{/if}{if $hr} hr{/if} | code preview fullscreen{if $jrembed || $jrsmiley} |{/if}{if $jrembed} jrembed{/if}{if $jrsmiley} jrsmiley{/if}"
});

You can see there are some dynamically set stuff in there, eg:
.....{if $span || $div} alignleft{/if}......

You could use an interface to setup the same structure for every option in there, its possible. but then instead of
    toolbar1: "formatselect | fontselect 
you have
    toolbar1: "{if $setting.formselect}formatselect{/if} | {if $setting.fontselect}fontselect{/if} 
etc....
so the whole page gets slightly more complex. Then what if you wanted to allow the user to change the order of those to switch them around. Currently to do that you'd change
    toolbar1: "formatselect | fontselect 
to
    toolbar1: "fontselect | formatselect
not hard. but to do the same thing from an interface with code is much more complex.

Its good as is. Its not like you're going to change things multiple times, you're likely to do it once then never again for the life of the site.

--edit--
[ Metaphor: A guy buys a set of leggo bricks. He assembles them into the shape of a spacecraft. Everybody knows that a spacecraft needs a bridge. He suggest to leggo that instead of just selling the rectangle plastic blocks they are famous for, that they also sell pre-assembled spacecraft bridge units. because everybody who builds a spacecraft out of leggo is going to need a bridge. Point: if you want a bridge, you can build one. We probably wont be offering that because the segment of the people that require this is too small.]
updated by @michael: 12/09/18 08:22:01PM
michael
@michael
12/09/18 08:05:11PM
7,821 posts

Using TinyMce editor to upload media


Using Jamroom

What will be put into the editor after you have added one of the files from a profile will be something like
[ jrEmbed module="jrFile" id="14"]
That will then be swapped out for a link to the actual file when the document is saved.

ACP -> MODULES -> CORE -> SYSTEM CORE -> QUOTA CONFIG -> Convert Embed Tags
also needs to be allowed for the profile using it.
quota_config.jpg quota_config.jpg - 160KB
michael
@michael
12/08/18 11:40:28PM
7,821 posts

Is it feasible to build a central "Text editor settings" control module?


Suggestions

yes.

Q: Why isn't it done yet?
A: Because what you have there now fairly closely matches the way TinyMce's documents show how to do thing now. So anything you can see works from their docs can reasonably easily be added to the form_editor.tpl file.

If we were to create another interface, the interface would store values in the database, then attempt to turn on/off the values of tinymce in the form_editor.tpl. That file would become much less editable than it is right now. It also probably would not contain all the possible settings of Tinymce:

TinyMce settings docs
https://www.tiny.cloud/docs/configure/

So what you would end up with would be
* An interface that is less configurable than you have now.
* A system that is more complex than you have now.

So if you were to build that, who would benefit.
* People who don't like looking at code.

--edit--
That doesn't mean that you cant build it (or have it built) as a module for yourself. Just saying that it probably wont be offered as a core feature.
updated by @michael: 12/08/18 11:42:58PM
michael
@michael
12/08/18 07:56:25PM
7,821 posts

Is it feasible to build a central "Text editor settings" control module?


Suggestions

Your code is correct strumelia. To get rid of the paragraph, remove the 'formatselect'.

Here is your code with that removed:
{jrCore_module_url module="jrCore" assign="murl"}
{jrCore_module_url module="jrImage" assign="imurl"}
tinymce.init({
    setup: function(ed) {
        var mce_body_fs = $('body').width();
        ed.on('FullscreenStateChanged', function(e) {
            if (e.state === true) { $('.form_editor_holder .mce-fullscreen').width(mce_body_fs); }
            else {
                $('.form_editor_holder .mce-panel').css('width','');
            }
        });
    },
    {if jrCore_is_mobile_device() && !jrCore_is_tablet_device()}
    mobile: { theme: 'mobile' },
    {/if}
    body_id: "{$form_editor_id}",
    branding: false,
    content_css: "{$jamroom_url}/{$murl}/css/{$murl}/jrCore_tinymce.css?v={$_mods.jrCore.module_updated}",
    images_upload_url: "{$jamroom_url}/{$imurl}/tinymce_imagetools",
    valid_elements : '*[*]',
    toolbar_items_size : "small",
    element_format: "html",
    fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt",
    autoresize_bottom_margin: "3",
    keep_styles: false,
    theme: "{$theme}",
    selector: "textarea#{$form_editor_id}",
    relative_urls: false,
    remove_script_host: false,
    convert_fonts_to_spans: true,
    menubar: false,
    statusbar: false,
    paste_auto_cleanup_on_paste : true,
    paste_remove_styles: true,
    paste_remove_styles_if_webkit: true,
    paste_strip_class_attributes: true,
    entity_encoding: "raw",
    height: "100%",
    image_advtab: true,
    browser_spellcheck: true,
    {if $table} table_toolbar: "tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol | tablecellprops tablesplitcells tablemergecells",{/if}
    {if $script}
    extended_valid_elements: "script[type|defer|src|language]",
    {/if}
    plugins: "lists,imagetools,pagebreak,{if $jrsmiley}jrsmiley,{/if}{if $jrembed}jrembed,media{/if},image,autoresize,{if $table}table,{/if}link,code,fullscreen,textcolor,colorpicker,preview{if $hr},hr{/if},tabindex,paste,anchor",
    toolbar1: "removeformat | fontselect fontsizeselect forecolor {if $strong} bold{/if}{if $em} italic{/if}{if $span} underline{/if} removeformat | {if $span || $div} alignleft{/if}{if $span || $div} aligncenter{/if}{if $span || $div} alignright{/if}{if $span || $div} alignjustify |{/if}{if $ul || $ol || $li}{if $ul || $li} bullist{/if}{if $ol} numlist{/if} |{/if}{if $div} outdent indent |{/if} undo redo | link unlink anchor pagebreak{if $table} table{/if}{if $hr} hr{/if} | code preview fullscreen{if $jrembed || $jrsmiley} |{/if}{if $jrembed} jrembed{/if}{if $jrsmiley} jrsmiley{/if}"
});

If its not showing up, my guess is you're editing the wrong template.

If you're editing
ACP -> MODULES -> CORE -> SYSTEM CORE -> TEMPLATES -> form_editor.tpl

and its not working, then check for an override at:
ACP -> SKINS -> YOUR SKIN -> TEMPLATES -> jrCore_form_editor.tpl
michael
@michael
12/07/18 10:47:23PM
7,821 posts

Is it feasible to build a central "Text editor settings" control module?


Suggestions

If "Open Sans" is not in the list, then it must be the default. If its the default then removing the formatting would return it to the default.

#3 a search for "tinymce adjust avaialbe font sizes" turned up this:
https://stackoverflow.com/questions/20183796/tinymce-4-how-change-font-size-styles
which suggests adding this to your form_editor.tpl file
 fontsize_formats: "8pt 9pt 10pt 11pt 12pt 26pt 36pt",
michael
@michael
12/07/18 10:42:20PM
7,821 posts

Comments in groups


Using Jamroom

in whichever template you're wanting to adjust put in {debug}
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1477/debug

Then find 2 matching variables, so something like:
{if $_user._user_id == $some_variable_for_the_user_id_who_owns_the_group}
put the code for the comments section in here
{/if}
so the comments box will only show if the user id of the user looking at the screen matches the user_id of the owner of the group.
michael
@michael
12/07/18 10:39:19PM
7,821 posts

menus and footer menu visibilty how?


Using Jamroom

Use the {debug} in your footer template to find out what variables you have.
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1477/debug

The one you're after is probably {$_user.user_quota_id} then wrap your menu items in a check
{if $_user.user_quota_id == 3}
Stuff here will only show to users in quota id 3
{/if}
michael
@michael
11/30/18 11:57:43PM
7,821 posts

Dynamically changing $_user quota settings


Jamroom Developers

jrProfile_get_quota() doesnt look like it touches $_user.

'session_started' is not such a commonly used listener judging by a code search. One set that is commonly used is:
* 'db_get_item'
* 'db_search_items'

eg:
    // Expand Poll options
    jrCore_register_event_listener('jrCore', 'db_get_item', 'jrPoll_db_get_item_listener');
    jrCore_register_event_listener('jrCore', 'db_search_items', 'jrPoll_db_search_items_listener');

Might try tweaking the data via both of those.

--edit--
Why: because the session start gets its info from:
jrCore_db_get_item('jrUser', $uid, true, true)) {.........
so you'd be tweaking before it arrived at the session start.
updated by @michael: 11/30/18 11:59:15PM
michael
@michael
11/30/18 11:51:04PM
7,821 posts

Img Tag Override to Amp-Img


Jamroom Developers

That template code looks like it will fail.

template:
{if jrCore_is_mobile_device()}
  {myModule_amplify html=$html}
{else}
  {$html}
{/if}
  101