Code Monkey home page Code Monkey logo

source-code-editor-tinymce-plugin's People

Contributors

melquibrito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

source-code-editor-tinymce-plugin's Issues

TinyMCE codesample Incompatibility

If you use the TinyMCE codesample plug-in alongside ace editor plug-in. Viewing the source code of HTML document with codesample inserted. When you save the HTML source from ace the code sample tags are reformatted.
Is there anyway resolve this ?

codesample before save

`

`

after save

<pre class="language-markup"><code></code></pre> <div class="card-footer position-relative"><a class="collapse-link collapsed stretched-link" data-bs-toggle="collapse" href="#collapse-2">View example's code</a></div> <pre class="language-markup"><code></code></pre>

Does not update correct editor when there are multiple editors on the page.

I have a page with 2 tinymce editors on it. And just installed your code editor plugin (which is very nice, BTW). If I try to use the code editor plugin on the first editor, when I click Save, it overwrites the contents of the second editor with the value instead of updating the first. It appears that tinymce.activeEditor is not always returning the editor that the plugin was called from. I hacked around it by passing the editor variable to displayToxEditorModal and setting the id of the editor as a data attribute on the modal, which I then read back in saveContent()... But I'm sure there's probably a cleaner way to do it.

function displayToxEditorModal(e, display = true) {
  let el = document.getElementById('tox-codeeditor-wrap');
  if (display) {
    el.dataset.editor = e.id;
    el.style.display = "flex";
    el.focus();
    document.body.classList.add('tox-codeeditor__disable-scroll');
  } else {
    e = e || tinymce.get(el.dataset.editor);
    el.style.display = "none";
    document.body.classList.remove('tox-codeeditor__disable-scroll');
    e.focus();
  }
}

function saveContent() {
  let el = document.getElementById('tox-codeeditor-wrap');
  let e = tinymce.get(el.dataset.editor);
  e.focus();
  e.undoManager.transact(function() {
    e.setContent(aceEditor.getValue())
  });
  e.selection.setCursorLocation();
  e.nodeChanged();
  displayToxEditorModal(e,false);
}

Default Language

Hello thank you for this plugin. Makes editing the source to easier. By default plugin seems to be reverting to the Spanish language when it should be English ?
Regards
Paul

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.