Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) => {