How to use the ace-builds/src-min-noconflict/ace.edit function in ace-builds

To help you get started, we’ve selected a few ace-builds 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 Chocobo1 / bencode_online / src / index.js View on Github external
function main()
{
  // editor configs
  const jsonEditor = document.getElementById('jsonEditor');
  const editor = ace.edit(jsonEditor);
  editor.getSession().setMode('ace/mode/json');
  editor.setShowPrintMargin(false);
  editor.setFontSize(14);

  // Characters stop showing up after the 10000th charater in a line
  // https://github.com/ajaxorg/ace/issues/3983
  editor.renderer.$textLayer.MAX_LINE_LENGTH=Infinity;

  function setEditorText(str)
  {
    editor.setValue(str);
  }

  jsonEditor.addEventListener('dragover', (ev) => { if (ev.preventDefault) ev.preventDefault(); });
  jsonEditor.addEventListener('dragenter', (ev) => { if (ev.preventDefault) ev.preventDefault(); });
  jsonEditor.addEventListener("drop", (ev) => {