How to use the tinymce/tinymce.get function in tinymce

To help you get started, we’ve selected a few tinymce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oroinc / platform / src / Oro / Bundle / FormBundle / Resources / public / js / app / components / create-or-select-choice-component.js View on Github external
$data.find(':input').each(_.bind(function(index, element) {
                const $element = $(element);
                let inputName = $element.attr('name');
                inputName = inputName.substr(inputName.indexOf('['));

                let $modifiedField = this.$newEntity.find('[name$="' + inputName + '"]');

                if ($element.is(':checkbox') || $element.is(':radio')) {
                    $modifiedField = this.$newEntity.find(
                        '[name$="' + inputName + '"][value="' + $element.val() + '"]'
                    );
                    $modifiedField.prop('checked', $element.is(':checked')).change();
                } else {
                    const editor = tinyMCE.get($modifiedField.attr('id'));
                    if (editor) {
                        editor.setContent($element.val());
                    } else {
                        $modifiedField.val($element.val()).change();
                    }
                }
            }, this));
github oroinc / platform / src / Oro / Bundle / ConfigBundle / Resources / public / js / form / default.js View on Github external
$(textareas).each(function(i, el) {
                        var editor = tinyMCE.get(el.id);
                        if (editor) {
                            editor.setMode($(el).prop('disabled') ? 'readonly' : 'code');
                        }
                    });
                }
github oroinc / platform / src / Oro / Bundle / EmailBundle / Resources / public / js / app / views / email-variable-view.js View on Github external
_.each(this.fields, function(el) {
                const editor = tinyMCE.get(el.id);
                if (editor) {
                    editor.setContent('');
                } else if (el.value) {
                    el.value = '';
                }
            });
        },
github oroinc / platform / src / Oro / Bundle / FormBundle / Resources / public / js / app / components / create-or-select-choice-component.js View on Github external
this.$newEntity.find(':input').each(function() {
                    const $input = $(this);
                    const editor = tinyMCE.get($input.attr('id'));

                    $input.data('saved-disabled', $input.prop('disabled'));
                    $input.prop('disabled', true);

                    if (editor && !$input.data('saved-disabled')) {
                        editor.setMode('readonly');
                        $(editor.editorContainer).addClass('disabled');
                        $(editor.editorContainer).append('<div class="disabled-overlay"></div>');
                    }
                });
            }
github oroinc / platform / src / Oro / Bundle / LocaleBundle / Resources / public / js / app / views / fallback-view.js View on Github external
enableDisableValue: function($element, enable) {
            const $$elementContainer = $element.closest(this.options.selectors.itemValue);

            let editor;
            if ($$elementContainer.find('.mce-tinymce').length > 0) {
                editor = tinyMCE.get($$elementContainer.find('textarea').attr('id'));
            }

            if (enable) {
                $element.removeAttr('disabled');

                if (editor) {
                    editor.setMode('design');
                    $(editor.editorContainer).removeClass('disabled');
                    $(editor.editorContainer).children('.disabled-overlay').remove();
                }
            } else {
                $element.attr('disabled', 'disabled');

                if (editor) {
                    editor.setMode('readonly');
                    $(editor.editorContainer).addClass('disabled');
github oroinc / platform / src / Oro / Bundle / LocaleBundle / Resources / public / js / app / views / fallback-view.js View on Github external
this.$el.find(this.options.selectors.itemValue).find('.mce-tinymce').each(function() {
                tinyMCE.get(self.getValueEl(self.getItemEl(this)).attr('id'))
                    .on('change', function() {
                        $(this.targetElm).change();
                    })
                    .on('keyup', function() {
                        $(this.targetElm).change();
                    });
            });
github oroinc / platform / src / Oro / Bundle / FormBundle / Resources / public / js / app / views / default-field-value-view.js View on Github external
$textareas.each(function(i, el) {
                const editor = tinyMCE.get(el.id);
                if (editor) {
                    editor.setMode($(el).prop('disabled') ? 'readonly' : 'code');
                }
            });
        }
github oroinc / platform / src / Oro / Bundle / LocaleBundle / Resources / public / js / app / views / localizable-collection-tabs-view.js View on Github external
this.$el.find(this.options.selectors.itemValue).find('.mce-tinymce').each(function() {
                tinyMCE.get(self.getValueEl(self.getItemEl(this)).attr('id'))
                    .on('change', function() {
                        $(this.targetElm).change();
                    })
                    .on('keyup', function() {
                        $(this.targetElm).change();
                    });
            });