We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42562
    • 1,145 Posts
    RE: DonQuicky
    Thanks!
    Glad you got that sorted out.
    If the awesome TinyMCE at tinymce.com, with its gazillion straightforward abilities, can do this or that, you should be able to implement those things easily in MODx with this wrapper.

    Also I noticed a deprecated skin_url you are using, I reckon the updated one is:
    [[++assets_url]]components/tinymcewrapper/tinymceskins/...
    Also, these below have a shortcode url JS variable, if you care to implement them, check the new chunk. It allows you to use your own differently-located responsivefilemanager (see the plugin's properties > responsiveFileManagerPath)
    external_plugins: {
          filemanager: "[[++assets_url]]components/tinymcewrapper/responsivefilemanager/filemanager/plugin.min.js",
          responsivefilemanager: "[[++assets_url]]components/tinymcewrapper/responsivefilemanager/tinymce/plugins/responsivefilemanager/plugin.min.js"
        },
    [ed. note: donshakespeare last edited this post 8 years, 9 months ago.]
      TinymceWrapper: Complete back/frontend content solution.
      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
      • 40088
      • 708 Posts
      Quote from: donshakespeare at Jul 17, 2015, 03:09 AM
      do the RichTVs remain activated even when RTE is disabled for that resource? I remember you and some complained about this issue.

      Yes, it works great for me.

      Todd
      https://creativ.space
        Todd
        • 4172
        • 5,888 Posts
        Thanks for the hard work on that.
        Great work with this tinymcewrapper!

        got it working with MIGX:
        https://github.com/Bruno17/MIGX/commit/a8785612d687ec74d893c493090fb8a5a417c069

        the default chunk 'TinymceWrapperMIGX' could look like that:

        tinymce.init({
        mode: "exact",
        elements: "tv[[+tv_id]]",
        skin_url:"[[++assets_url]]components/tinymcewrapper/tinymceskins/fairOphelia",
        statusbar : false,
        plugins:"autoresize,preview,paste,contextmenu,image,wordcount,fullscreen,code,link,charmap,searchreplace,textpattern,emoticons,insertdatetime",
        link_list:[
        [[-$TinymceWrapperLinkList]]
        ],
        paste_data_images: true,
        textpattern_patterns: [
                 {start: '*', end: '*', format: 'italic'},
                 {start: '**', end: '**', format: 'bold'},
                 {start: '#', format: 'h1'},
                 {start: '##', format: 'h2'},
                 {start: '###', format: 'h3'},
                 {start: '####', format: 'h4'},
                 {start: '#####', format: 'h5'},
                 {start: '######', format: 'h6'},
                 {start: '1. ', cmd: 'InsertOrderedList'},
                 {start: '* ', cmd: 'InsertUnorderedList'},
                 {start: '- ', cmd: 'InsertUnorderedList'}
            ],
        browser_spellcheck: true,
        gecko_spellcheck: true,
        paste_data_images: false,
        paste_word_valid_elements: "a,div,b,strong,i,em,h1,h2,h3,p,blockquote,ol,ul,pre",
        valid_elements: "iframe[*],object[*],audio[*],-span[!title|!class<test test2],a[href|target|class|rel|title|data-ajax|data-iframe],strong,b,-p[class<text-align-left?text-align-center?text-align-right],br,-h1[class|data-ajax|data-iframe],-h2[class|data-ajax|data-iframe],-h3[class|data-ajax|data-iframe],-img[!src|!alt|!class=round_img|data-ajax|data-iframe],em,-blockquote,pre[class],-ol,-ul,-li,-code[class]",
        valid_children: "-li[ul],-li[ol],-li[div],-strong[*],-em[*],-h1[*],-h2[*],-h3[*],-a[strong|em|h1|h2|h3|p|div],blockquote[p|ol|ul],pre,div",
        menubar:false,
        relative_urls: false,
        resize:true,
        autoresize_min_height:100,
        autoresize_max_height:400,
        toolbar: "newdocument | fullscreen preview | undo redo | blockquote | bold | italic | aligncenter | bullist numlist | link unlink | image responsivefilemanager | styleselect | charmap emoticons insertdatetime | searchreplace",
        image_advtab: true,
        external_filemanager_path: extFilemanagerPath,
        filemanager_title: "Responsive Filemanager 9.9.3 For MODx Revo 2.3+",
        external_plugins: {
              filemanager: extPluginsFilemanager,
              responsivefilemanager: extPluginsResponsivefilemanager
            },
        contextmenu: "removeformat | link | image responsivefilemanager | code",
        setup: function(editor) {
                editor.on('keydown', function(evt) {
                    if (evt.keyCode == 83 && evt.ctrlKey && !evt.shiftKey && !evt.altKey && !evt.metaKey) {
                   evt.preventDefault();
                   $('#modx-abtn-save button').trigger("click");
               }
                });
            }
        });


        and you can define different chunks for different MIGX - fields.
        In the MIGX - configurator have this in the configs - field for that field:
        {"tinymce_chunk":"TinymceWrapperMIGX_custom"}
        

          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 42562
          • 1,145 Posts
          RE: Bruno17
          Thank you very much for this. Finally MIGX is covered! Excellent.

          Questions
          1. Do I have to do anything? Maybe add this sample chunk to the plugin's package?
          2. Are any of the MIGX' fields ever created on the fly with EXTjs - do I need to reinit or init TinyMCE for the MIGX textareas on demand?
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 4172
            • 5,888 Posts
            Quote from: donshakespeare at Jul 19, 2015, 06:02 PM
            RE: Bruno17
            Thank you very much for this. Finally MIGX is covered! Excellent.

            Questions
            1. Do I have to do anything? Maybe add this sample chunk to the plugin's package?
            2. Are any of the MIGX' fields ever created on the fly with EXTjs - do I need to reinit or init TinyMCE for the MIGX textareas on demand?

            1. yes, would be good, you would add the sample chunk.

            2. the tinymce-instances are created and removed on the fly in tinymcewrapper.tpl, which calls the chunk for initialising the textareas

            I think, I will send all values of the configs-json of that field as properties for placeholders to the chunk.
            Would also be good, if the tinymce was there on MIGX - CMPs for usage in the modal.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 42562
              • 1,145 Posts
              RE: Bruno17
              Okay, just added the chunk for next release.

              jQuery and TinyMCE will have to be running at the time MIGX is used (it is already in OnDocFormPrerender)

              Are these the only System Events in which MIGX is available?
              OnDocFormPrerender
              OnTVInputPropertiesList
              OnTVInputRenderList
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 4172
                • 5,888 Posts
                I think, something like
                OnManagerPageBeforeRender

                or

                OnBeforeManagerPageInit

                or

                OnManagerPageInit

                to load it also at CMPs


                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 42562
                  • 1,145 Posts
                  Perfect! Thanks.
                  Next release comes with some features that do require OnManagerPageInit.
                    TinymceWrapper: Complete back/frontend content solution.
                    Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                    5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                    • 42562
                    • 1,145 Posts
                    TinymceWrapper 2.1.0 http://modx.com/extras/package/tinymce_wrapper

                    Changelog TinymceWrapper 2.1.0
                    ---------------------------------
                    0. Updated TinymceWrapper Sample Resource
                    1. Added MIGX TinyMCE sample chunk - Thanks to *Bruno17 for connecting it with MIGX (see his post in the support thread)
                    2. Added support for Quick Create/Update Resources from Resource Tree *my favourite!
                    3. Added Responsive FileManager switchoffable link to Manager Top Nav > Media drop-down
                    4. Automatic detection of your MODx CORE PATH - Thanks to BobRay
                    5. Added caution check for Articles Container
                    6. Added new System Events for Manager-wide enjoyment of these new features
                    7. Fixed bug that prevented textareas(being temporarily disabled) to update content on save (no need to re-enable before saving)
                    8. Fixed bug that locked out TV textareas when enableDisable button is disabled by the plugin
                    9. Fixed bug where File & Image TV RFM popup do not work if RichTV is disabled
                    10. Fixed issue with TV reset: now works to revert textarea content to TV default even if TinyMCE is presently enabled
                    11. Fixed issue with RFM(images) & RFM(all files) modal - eliminated need for & deleted tinymceskins/blank folder
                    ____________________________________

                    -------Responsive FileManager-------
                    ____________________________________
                    1. Updated Responsive FileManager to 9.9.4 (http://www.responsivefilemanager.com/)
                    -Changes in Version 9.9.4 (2015/07/18)
                    -Upgrade Aviary Image Editor with new Adobe Creative SDK without size limitation
                    -Add files and folders counter on each folder
                    -Fixed a problem with folder selection on relative url
                    2. Eliminated need to manually enter path of core folder or Index.php file. RFM works instantly, being auto connected to MODx. Thanks to *BobRay for the long-sort implementation/idea.
                    3. Filenames clean up [ed. note: donshakespeare last edited this post 8 years, 9 months ago.]
                      TinymceWrapper: Complete back/frontend content solution.
                      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                      • 42562
                      • 1,145 Posts
                      How easy it is to attack any button in an instance of TinyMCE
                      I want the fullscreen button (with preview button if I like) to float right, like you see in other RTEs
                      To separate buttons in TinyMCE use this xter |, example: fullscreen | preview

                      setup: function(editor) { //find this line in your chunk
                        ...
                       editor.on("init",function() {
                       containerId = $(editor.getContainer()).attr("id");
                        $("#"+containerId+" .mce-i-fullscreen").parent().parent().parent().parent().css("float","right");
                       });
                        ...
                      }
                      
                        TinymceWrapper: Complete back/frontend content solution.
                        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.