Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Galina 44 posts 258 karma points
    Sep 26, 2014 @ 10:22
    Galina
    0

    Fire LoadContent event in custom tinyMceEditor

    Hello

    I have an issue: it's needed to add macro in RTE as html-code and after that to reload content to see macro.

    I get the correct "html" 

    <div class="umb-macro-holder mceNonEditable"><!--<?UMBRACO_MACRO macroAlias="DetailDetail" IsDetail="0" IsReview="0" DetailId="5814311" EntityID="5814311" ViewId="" Style="" Type="" BannerId="" />--><ins>Macro alias: <strong>DetailDetail</strong></ins> </div>
    <p> </p>
    <div class="umb-macro-holder mceNonEditable"><!--<?UMBRACO_MACRO macroAlias="CommonLogin" EntityID="" />--><ins>Macro alias: <strong>CommonLogin</strong></ins> </div>
    <p> </p>
    <div class="umb-macro-holder mceNonEditable"><!--<?UMBRACO_MACRO macroAlias="SearchSearch" HelpEntityId="" Style="" EntityID="" ActionEntityId="" SearchTextInput="" />--><ins>Macro alias: <strong>SearchSearch</strong></ins> </div>

    after I saved the page and reload it manually, I could see macros

    But how sholud I reload the RTE content  by js and see macro before page save?

  • Galina 44 posts 258 karma points
    Sep 29, 2014 @ 08:43
    Galina
    100

    Hello. Here is the answer:

    function MyController($scope, $routeParams, $http) {

            $scope.property = {

                view: 'rte',

                config: {

                    editor: {

                        toolbar: ["code", "undo", "redo", "cut", "styleselect", "bold", "italic", "alignleft", "aligncenter", "alignright", "bullist", "numlist", "link", "umbmediapicker", "umbmacro", "table", "umbembeddialog"],

                        dimensions: { height: '400px' }

                    }

                },

                value: $scope.model.value

            };

            $scope.$watch('property.value', function(newValue, oldValue) {

                var rg = /<div.*?class="umb-macro-holder.*?mceNonEditable.*?\>.*?(\<\?UMBRACO_MACRO.*?macroAlias="(.*?)".*?\/\>)[\s\S]*?<\/ins><\/div>/gim;

                $scope.model.value = newValue.replace(rg, "<div class=\"umb-macro-holder mceNonEditable\"><!-- $1 --><ins>Macro alias: <strong>$2</strong</ins></div>");

                tinyMCE.EditorManager.activeEditor.fire('LoadContent', null);

            });

    }

  • admiss 20 posts 100 karma points
    Aug 03, 2016 @ 22:33
    admiss
    0

    Hi,

    Does anyone know, how to make the Macro content editable in TinyMice3 RTE? The NoneEditable Plugin - or the Grid - is passing automatically the "umb-macro-holder mceNonEditable" class to Macros, which is preventing users from being able to change (i.e. edit) content in the RTE within this class.

    Wondering where to find & change it to "mceEditable" - or trying to figure out why is TinyMice passing mceNonEditable to Macros??

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft