Skip to content

Instantly share code, notes, and snippets.

@fininhors
Created July 1, 2021 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fininhors/ce7f1ae3357f9dece4a20b49f44eeaf1 to your computer and use it in GitHub Desktop.
Save fininhors/ce7f1ae3357f9dece4a20b49f44eeaf1 to your computer and use it in GitHub Desktop.
Exemplo de uso de tinymce
tinymce.init({
selector: '.texto',
forced_root_block : '',
valid_elements : '*[*]',
height: 500,
language: 'pt_BR',
end_container_on_empty_block: true,
branding: false,
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template code table charmap hr nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern help',
toolbar1: "bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor litebox responsivefilemanager image | media code | preview | forecolor backcolor",
toolbar3: "bootstrap_icons | table | hr removeformat | subscript superscript | charmap emoticons fullscreen | ltr rtl | visualchars visualblocks nonbreaking pagebreak template fecharsecao",
imagetools_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions",
image_lith: true,
relative_urls: false,
fontsize_formats: 'xx-small x-small small medium large x-large xx-large 6px 7px 8px 9px 10px 11px 12px 13px 14px 15px 16px 17px 18px 19px 20px 21px 22px 23px 24px 26px 28px 30px 32px 36px 38px 42px 64px 72px 104px 150px',
image_advtab: true,
images_upload_url: '/admin/file_oupload',
image_caption: true,
images_upload_credentials: true,
content_css: "{{ asset('css/site/bootstrap.css') }},{{ asset('css/site/font.css') }},{{ asset('css/site/main.css') }}",
template_selected_content_classes: 'replace',
templates: [
{
title: 'Seção Fundo Branco ( Título + Texto )',
description: 'Código importado.',
url: "{{ asset('js/admin/plugins/tinymce/templates/fundo-branco-texto-titulo.html') }}"
},
{
title: 'Seção Fundo Branco GELO ( Título + Texto )',
description: 'Código importado.',
url: "{{ asset('js/admin/plugins/tinymce/templates/fundo-gelo-texto-titulo.html') }}"
},
{
title: 'Seção Fundo Amarelo ( Título + Tabela )',
description: 'Seção do site com o fundo na cor amarela.',
url: "{{ asset('js/admin/plugins/tinymce/templates/fundo-amarelo-titulo-tabela.html') }}"
},
],
setup: function (editor) {
editor.ui.registry.addButton('fecharsecao', {
icon: 'save',
tooltip: 'Fechar Seção',
onAction: function () {
editor.setContent(editor.getContent() + '<div class="replace" style="background-color:#000000">SUBSTITUIR</div>');
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment